package bugfixes;

/***
 * 
 * v2 improvements:
 * 
 * RSPlayer, RSCharacter and RSNPC accessors
 * 
 * 
 * @author wolf
 *
 */

public class ImportFix extends Fix{

	@Override
	public String fixed(String in) {
		
		in = in.replaceAll("import org\\.rsbot\\.accessors\\.(.*);", "import org.rsbot.client.$1;");
		
		//in = in.replace("import org.rsbot.accessors.Node;", "import org.rsbot.client.Node;");
		//in = in.replace("import org.rsbot.accessors.RSNPCNode;", "import org.rsbot.client.RSNPCNode;");
		
		in = in.replace("import org.rsbot.bot.input.CanvasWrapper;", "import org.rsbot.client.input.Canvas;");
		in = in.replace("CanvasWrapper", "Canvas");
		
		in = in.replace("Bot.getClient().getDetailInfo()", "Bot.getClient().getDetailInfoNode()");
		
		in = in.replaceAll("ScreenshotUtil\\.takeScreenshot\\((true|false)\\);", "// ScreenshotUtil.takeScreenshot(true); disabled by Wolf's Infinity BugFixer due to no getBot() method");
		
		in = in.replace("import org.rsbot.bot.input.Listener", "import org.rsbot.client.input.Listener");
		in = in.replace("import org.rsbot.bot.input.Mouse", "import org.rsbot.client.input.Mouse");
		
		in = in.replace("org.rsbot.accessors.RSPlayer", "org.rsbot.client.RSPlayer");
		in = in.replace("org.rsbot.accessors.RSNPC", "org.rsbot.client.RSNPC");
		in = in.replace("org.rsbot.accessors.RSCharacter", "org.rsbot.client.RSCharacter");
		
		return in;
	}

}
